#include <stdio.h>
#include <stdlib.h>
#include <string.h>


int main() {
    char num[] = "123#2#2#2235/56";
    char res[1000];
    int resLen = 0;
    memset(res, 0, sizeof(char) * 1000);

    int alpha = 0;
    char a[10][7] = {"0 ", "1,.", "2abc", "3def", "4ghi", "5jkl", "6mno", "7pqrs", "8tuv", "9wxyz"};

    int n = strlen(num);
    
    int p = 0;
    while (p < n) {
        while (p < n && num[p] != '#') {
            if (alpha == 0) {
                res[resLen++] = num[p++];
            } else {
                int sum = 0;
                while (p < n - 1 && num[p] == num[p + 1] && num[p] != '/') {
                    sum++;
                    p++;
                }
                if (p < n && num[p] == '/') {
                    p++;
                    continue; 
                }
                if (p < n) {
                    char* tmp = (char*)malloc(sizeof(char));
                    strncpy(tmp, &num[p], sizeof(char) * 1);
                    int index = atoi(tmp);
                    int index2 = sum % (strlen(a[index]) - 1);
                    char add = a[index][index2 + 1];
                    res[resLen++] = add;
                    p++;
                    free(tmp);
                }
                

            }
        
        }
        if (p < n && num[p] == '#') {
            alpha = (alpha == 0) ? 1 : 0;
            ++p;
            }
    }
    
    printf("%s", res);



    return 0;
}